<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddColumnsToRefundTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('el_refund', function (Blueprint $table) {
            $table->string('channel')->default('ec'); //来源：ec 电商；shop 门店
            $table->integer('channel_id')->default(0); //如果channel=shop，为门店ID，否则为0
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('el_refund', function (Blueprint $table) {
            //
            $table->dropColumn(['channel', 'channel_id']);
        });
    }
}
